SET NOCOUNT ON
SET QUOTED_IDENTIFIER ON
GO

PRINT '---- tblContributionDiscounts'
PRINT '-- Table title'
INSERT tblUFGTableTitles (utt_Tablename, utt_Languagename, utt_Title, utt_Description)
VALUES ('tblContributionDiscounts','Nederlands','Contributie kortingen','Kortingsoorten voor contributies')

PRINT '-- Column titles'
INSERT tblUFGColumnTitles
(uct_TableName,uct_ColumnName,uct_Languagename,uct_Title,uct_SubTitle)
VALUES ('tblContributionDiscounts','cdc_Clubname','Nederlands','Clubnaam','U dient een clubnaam in te vullen.')

INSERT tblUFGColumnTitles
(uct_TableName,uct_ColumnName,uct_Languagename,uct_Title,uct_SubTitle)
VALUES
('tblContributionDiscounts','cdc_Season','Nederlands','Seizoen','U dient een seizoen in te vullen.')

INSERT tblUFGColumnTitles
(uct_TableName,uct_ColumnName,uct_Languagename,uct_Title,uct_SubTitle)
VALUES
('tblContributionDiscounts','cdc_Discount','Nederlands','Korting soort','U dient een korting soort te selecteren.')

UPDATE tblUFGForeignKeyColumns
SET ufc_AdditionalWhere = 'dbo.fnGetClubnameByUser(@UFGUsername) IN (clb_Name, ''*'')'
WHERE ufc_ForeignKeyName = 'FK_cdc_Clubname'
AND ufc_TableName = 'tblContributionDiscounts'
AND ufc_ColumnName = 'cdc_ClubName'
AND ufc_ReferenceTableName = 'tblClubs'
AND ufc_ReferenceColumnName = 'clb_Name'

INSERT tblUFGRowRights
(urr_TableName,urr_RoleName,urr_SQLSelectExpression,urr_SQLInsertExpression,urr_SQLUpdateExpression,urr_SQLDeleteExpression)
SELECT 'tblContributionDiscounts',urr_Rolename,'cdc_ClubName = dbo.fnGetClubnameByUser(@UFGUsername)',null,'cdc_ClubName = dbo.fnGetClubnameByUser(@UFGUsername)','cdc_ClubName = dbo.fnGetClubnameByUser(@UFGUsername)'
FROM tblUFGRoles
WHERE urr_RoleName LIKE '%Club'
OR urr_RoleName = 'Leden'